<?php
// base class in PHP, in which the an abstract method is called
    abstract class BASE
    {
        // constructor
        public function __construct() {
            // call abstract method
            $this->doSomething();
        }

        // abstract method to be implemented by derived classes
        public abstract function doSomething();
    }

    // the derived class
    class DERIVED extends BASE {
        // implement the abstract method
        public function doSomething() {
            echo "doSomething() \n";
        }
    }

    // create an instance of the derived class
    $d = new DERIVED();